<!DOCTYPE html><html><head><title>2020年第01期JS基础课入学考试</title><meta charset='utf-8'><link href='https://cdn.maxiang.io/res-min/themes/marxico.css' rel='stylesheet'><style>.note-content  {font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", STHeiti, "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, Song, sans-serif;}


</style></head><body><div id='preview-contents' class='note-content'>
                        
                    

<h3 id="2020年第01期js基础课入学考试">2020年第01期JS基础课入学考试</h3>

<blockquote>
  <p>请在答题前 <br>
  1.写上自己的 <code>姓名、QQ、电话</code>（通知考试成绩） <br>
  2.答题时不需要抄写题目，标清序号写答案即可 <br>
  3.考试时间90分钟，总分100，基础40分，综合大题60分，请妥善安排时间 <br>
  4.答题完毕后，把答案导出为<code>.html / .pdf</code>等格式发给周老师 <br>
  5.考试期间不准作弊，一旦发现，珠峰永不招收，最后祝君好运~~~</p>
</blockquote>



<h4 id="一基础知识测试-40分">一、基础知识测试 <code>(40分)</code></h4>

<p>01、JS中的数据类型都有哪些？以及之间的区别？ <br>
02、检测数据类型的四种方式？（常见面试题） <br>
03、JS中创建变量的几种常用方式？ <br>
04、常用浏览器的内核都有哪些？（常见面试题） <br>
05、写出下面程序的输出结果（腾讯面试题）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> num = <span class="hljs-built_in">parseFloat</span>(<span class="hljs-string">'width:100px'</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-keyword">if</span>(num===<span class="hljs-number">100</span>){
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>   alert(<span class="hljs-number">1</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span>}<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(num===<span class="hljs-literal">NaN</span>){
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span>   alert(<span class="hljs-number">2</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span>}<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(<span class="hljs-keyword">typeof</span> num===<span class="hljs-string">'number'</span>){
</div><div class="hljs-line"><span class="hljs-comment line-number">7.</span>   alert(<span class="hljs-number">3</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">8.</span>}<span class="hljs-keyword">else</span>{
</div><div class="hljs-line"><span class="hljs-comment line-number">9.</span>   alert(<span class="hljs-number">4</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">10.</span>}
</div></code></pre>

<p>06、写出下面程序输出几次，结果分别是多少？（腾讯面试题）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i=<span class="hljs-number">0</span>;i&lt;<span class="hljs-number">10</span>;i+=<span class="hljs-number">2</span>){
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>    <span class="hljs-keyword">if</span>(i&lt;=<span class="hljs-number">5</span>){
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>        i++;
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span>        <span class="hljs-keyword">continue</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span>    }<span class="hljs-keyword">else</span>{
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span>        i+=<span class="hljs-number">3</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">7.</span>        <span class="hljs-keyword">break</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">8.</span>    }
</div><div class="hljs-line"><span class="hljs-comment line-number">9.</span>    alert(i);
</div><div class="hljs-line"><span class="hljs-comment line-number">10.</span>}
</div><div class="hljs-line"><span class="hljs-comment line-number">11.</span>alert(i);
</div></code></pre>

<p>07、向下面数组末尾追加一个值100你有几种办法？(至少两种)</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> ary = [<span class="hljs-number">12</span>,<span class="hljs-number">14</span>,<span class="hljs-number">13</span>,<span class="hljs-number">35</span>,<span class="hljs-number">16</span>,<span class="hljs-number">28</span>];
</div></code></pre>

<p>08、把下面的数组进行排序（降序）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> ary = [<span class="hljs-number">12</span>,<span class="hljs-number">14</span>,<span class="hljs-number">13</span>,<span class="hljs-number">35</span>,<span class="hljs-number">16</span>,<span class="hljs-number">28</span>];
</div></code></pre>

<p>09、实现找到数组<strong>第n项</strong>到<strong>第m项</strong>(<strong>包括n和m</strong>)的内容，返回一个新的数组（百度面试题） <br>
10、完成以下字符串处理需求（常见面试题）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> time = <span class="hljs-string">'2017-10-20'</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-comment">//-&gt;需要获取的结果是 ‘2017/10/20’</span>
</div></code></pre>

<p>11、简述字符串截取方法<code>substr</code>、<code>substring</code>、<code>slice</code>三者间的区别?（联想面试题） <br>
12、获取 2~93 之间的随机整数(包含2也包含93) <br>
13、写出下面代码的输出结果？（腾讯面试题）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> result = <span class="hljs-number">1</span>+<span class="hljs-literal">null</span>+<span class="hljs-literal">true</span>+<span class="hljs-literal">undefined</span>+<span class="hljs-string">'Tencent'</span>+<span class="hljs-literal">false</span>+[]+<span class="hljs-literal">undefined</span>+<span class="hljs-literal">null</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-built_in">console</span>.log(result);
</div></code></pre>

<p>14、写出下面代码的输出结果？</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span>A：<span class="hljs-number">3</span>-<span class="hljs-string">'1px'</span>?alert(<span class="hljs-number">2</span>):alert(<span class="hljs-number">3</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>B：<span class="hljs-number">3</span>+<span class="hljs-string">'1px'</span>?alert(<span class="hljs-number">4</span>):alert(<span class="hljs-number">3</span>);
</div></code></pre>

<p>15、</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-comment">//=&gt;已知下面代码可以修改BOX元素的样式</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>box.style.color = <span class="hljs-string">'red'</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span><wbr>
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><span class="hljs-comment">//=&gt;那么下面的写法是否可以修改元素的样式，如果不可以是为什么？</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span><span class="hljs-comment">//第一种方案</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span><span class="hljs-keyword">let</span> AA = box.style;
</div><div class="hljs-line"><span class="hljs-comment line-number">7.</span>AA.color = <span class="hljs-string">'red'</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">8.</span>​
</div><div class="hljs-line"><span class="hljs-comment line-number">9.</span><span class="hljs-comment">//第二种方案</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">10.</span><span class="hljs-keyword">let</span> BB = box.style.color;
</div><div class="hljs-line"><span class="hljs-comment line-number">11.</span>BB = <span class="hljs-string">'red'</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">12.</span>​
</div><div class="hljs-line"><span class="hljs-comment line-number">13.</span><span class="hljs-comment">//=&gt;哪种方式可以实现，不能实现是因为啥？</span>
</div></code></pre>

<p>16、如下</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">var</span> name = <span class="hljs-number">10</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-keyword">var</span> obj = {
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>    <span class="hljs-attr">name</span>: <span class="hljs-string">'珠峰培训'</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span>};
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span><span class="hljs-built_in">console</span>.log(obj[<span class="hljs-string">'name'</span>]);
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span><span class="hljs-built_in">console</span>.log(obj[name]);
</div></code></pre>

<p>17、分析下面的代码，写出运行的结果（百度面试题）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> a = <span class="hljs-number">12</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-keyword">let</span> b = a;
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>b = <span class="hljs-number">13</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><span class="hljs-built_in">console</span>.log(a);
</div></code></pre>



<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> a = {<span class="hljs-attr">n</span>:<span class="hljs-number">12</span>};
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-keyword">let</span> b = a;
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>b[<span class="hljs-string">'n'</span>] = <span class="hljs-number">13</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><span class="hljs-built_in">console</span>.log(a.n);
</div></code></pre>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> a = {<span class="hljs-attr">n</span>:<span class="hljs-number">12</span>};
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-keyword">let</span> b = a;
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>b = {<span class="hljs-attr">n</span>:<span class="hljs-number">13</span>};
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><span class="hljs-built_in">console</span>.log(a.n);
</div></code></pre>

<p>18、写出下面代码运行的结果 （阿里面试题）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> a = {
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>    <span class="hljs-attr">n</span>: <span class="hljs-number">10</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>};
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><span class="hljs-keyword">let</span> b = a;
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span>b.m = b = {
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span>    <span class="hljs-attr">n</span>: <span class="hljs-number">20</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">7.</span>};
</div><div class="hljs-line"><span class="hljs-comment line-number">8.</span><span class="hljs-built_in">console</span>.log(a);
</div><div class="hljs-line"><span class="hljs-comment line-number">9.</span><span class="hljs-built_in">console</span>.log(b);
</div></code></pre>

<p>19、写出下面代码输出的结果</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-keyword">let</span> i=<span class="hljs-number">1</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-built_in">console</span>.log(<span class="hljs-number">1</span>-(++i)+(i--)+<span class="hljs-number">1</span>+(i++)-(--i)<span class="hljs-number">-1</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span><span class="hljs-built_in">console</span>.log(i);
</div></code></pre>

<p>20、写出下面代码的输出结果</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">typeof</span> <span class="hljs-string">"Number(null)"</span> + !<span class="hljs-built_in">Number</span>(<span class="hljs-literal">null</span>));
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-built_in">console</span>.log(<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">""</span>) + <span class="hljs-built_in">Number</span>(<span class="hljs-string">""</span>));
</div></code></pre>

<h4 id="二综合实战测试-60分每题12分">二、综合实战测试 <code>60分：每题12分</code></h4>

<p>1、补充代码实现最后的效果（任意数求和）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sum</span>(<span class="hljs-params"></span>)</span>{
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>    <span class="hljs-comment">//=&gt;在这里实现你的代码</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span><wbr>
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span>}
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span><span class="hljs-keyword">let</span> total = sum(<span class="hljs-number">10</span>,<span class="hljs-number">20</span>,<span class="hljs-string">'30'</span>,<span class="hljs-string">'珠峰'</span>,<span class="hljs-string">'40'</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span><span class="hljs-built_in">console</span>.log(total); <span class="hljs-comment">//=&gt;100</span>
</div></code></pre>

<p>2、补充代码实现最后的结果（常见面试题）</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">queryURLParameter</span>(<span class="hljs-params">url</span>)</span>{
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>    <span class="hljs-comment">//=&gt;在这里实现你的代码</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span><wbr>
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span>}
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span><span class="hljs-keyword">let</span> str = <span class="hljs-string">'http://www.zhufengpeixun.com/stu/?name=zxt&amp;age=28&amp;sex=0#teacher'</span>;
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span><span class="hljs-keyword">let</span> result = queryURLParameter(str);
</div><div class="hljs-line"><span class="hljs-comment line-number">7.</span><span class="hljs-built_in">console</span>.log(result);
</div><div class="hljs-line"><span class="hljs-comment line-number">8.</span><span class="hljs-comment">/*</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">9.</span><span class="hljs-comment"> {</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">10.</span><span class="hljs-comment">   name:'zxt',</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">11.</span><span class="hljs-comment">   age:28,</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">12.</span><span class="hljs-comment">   sex:0,</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">13.</span><span class="hljs-comment">   HASH:'teacher'</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">14.</span><span class="hljs-comment"> }</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">15.</span><span class="hljs-comment">*/</span>
</div></code></pre>

<p>3、看需求文档，实现相关的JS代码（偏难）</p>

<blockquote>
  <p>在珠峰毕业后，你成功进入了一家上市公司，公司专门是为用户提供 “车牌号摇号” 服务的；现在公司的领导想让你实现一个<code>随机摇号功能</code>： <br>
  1、车牌号开始必须是：<code>京A、京B、京C、京E、京F、京G、京H、京J、京K （没有D和I）</code> <br>
  2、车牌号是五位，分别由<code>26个大写字母</code>和<code>0~9十个数字</code>组成 <br>
  3、当用户点击页面上的摇号按钮，你编写的程序给用户随机生成一个车牌号，用户感觉不满意，还可以重新摇号，但是最多只能摇三次</p>
</blockquote>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span>&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">'box'</span>&gt;
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>    <span class="xml"><span class="hljs-comment">&lt;!--P：存放生成的车牌号--&gt;</span></span>
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span><span class="xml">    <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'licensePlate'</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span></span>
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><span class="xml">    <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'button'</span> <span class="hljs-attr">value</span>=<span class="hljs-string">'摇号'</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'shakeBtn'</span>/&gt;</span> </span>
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="actionscript"></span></span>
</div><div class="hljs-line"><span class="hljs-comment line-number">7.</span><span class="xml">    <span class="hljs-comment">//=&gt;完成你的JS代码，实现老板安排的需求</span></span>
</div><div class="hljs-line"><span class="hljs-comment line-number">8.</span><span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></span>
</div></code></pre>

<p>4、看需求实现相关的JS代码（选项卡）</p>

<p><img longdesc="./1584075446661.png" alt="Alt text" title="" type="image/png" src="" class=""> <br>
鼠标滑过上面的页卡，底下的内容可以跟着切换</p>

<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-comment">/*</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span><span class="hljs-comment"> * navList：页卡区域的五个LI元素集合 </span>
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span><span class="hljs-comment"> * conList：内容区域的五个DIV元素集合 </span>
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><span class="hljs-comment"> */</span> 
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span><span class="hljs-keyword">var</span> tabBox = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'tabBox'</span>),
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span>    navList = tabBox.getElementsByTagName(<span class="hljs-string">'li'</span>),
</div><div class="hljs-line"><span class="hljs-comment line-number">7.</span>    conList = tabBox.getElementsByTagName(<span class="hljs-string">'div'</span>);
</div><div class="hljs-line"><span class="hljs-comment line-number">8.</span><span class="hljs-comment">//向下完成你的代码</span>
</div></code></pre>

<p>5、有如下数组，我们期望<code>把数组中重复项去除</code>后，然后再让数组<code>按照升序进行排序</code></p>



<pre class="prettyprint with-line-number hljs-dark"><code class="language-javascript hljs"><div class="hljs-line"><span class="hljs-comment line-number">1.</span><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">handle</span>(<span class="hljs-params">arr</span>)</span>{
</div><div class="hljs-line"><span class="hljs-comment line-number">2.</span>    <span class="hljs-comment">//完成你的代码</span>
</div><div class="hljs-line"><span class="hljs-comment line-number">3.</span>}
</div><div class="hljs-line"><span class="hljs-comment line-number">4.</span><wbr>
</div><div class="hljs-line"><span class="hljs-comment line-number">5.</span><span class="hljs-keyword">let</span> arr = handle([<span class="hljs-number">12</span>,<span class="hljs-number">14</span>,<span class="hljs-number">23</span>,<span class="hljs-number">12</span>,<span class="hljs-number">13</span>,<span class="hljs-number">24</span>,<span class="hljs-number">23</span>,<span class="hljs-number">12</span>,<span class="hljs-number">6</span>,<span class="hljs-number">24</span>,<span class="hljs-number">32</span>]);
</div><div class="hljs-line"><span class="hljs-comment line-number">6.</span><span class="hljs-built_in">console</span>.log(arr); <span class="hljs-comment">//=&gt;[6, 12, 13, 14, 23, 24, 32]</span>
</div></code></pre></div></body></html>